<?php

declare(strict_types=1);

namespace App\Hoenix\Model;

use Hyperf\Database\Model\Relations\HasOne;
use Mine\MineModel;

/**
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property int $id 主键
 * @property int $user_id
 * @property int $concubine_user_id
 * @property int $concubine_id
 * @property int $accept 1是2否
 * @property int $complete 完成0否1是2毁单
 * @property int $rating 1-5心
 * @property string $content 评价
 * @property array $image
 * @property array $video
 * @property-read null|HoenixConcubine $concubine
 */
class HoenixConcubineOrder extends MineModel
{
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'hoenix_concubine_order';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['created_at', 'updated_at', 'id', 'user_id', 'concubine_user_id', 'concubine_id', 'accept', 'complete', 'rating', 'content', 'image', 'video'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['created_at' => 'datetime', 'updated_at' => 'datetime', 'id' => 'integer', 'user_id' => 'integer', 'concubine_user_id' => 'integer', 'concubine_id' => 'integer', 'accept' => 'integer', 'complete' => 'integer', 'rating' => 'integer', 'image' => 'array', 'video' => 'array'];

    public function concubine(): HasOne
    {
        return $this->hasOne(HoenixConcubine::class, 'id', 'concubine_id');
    }
}
